package com.yfq.springframework.util;

/**
 * @author 姚凤桥
 * @date 2022/12/5 21:43
 * @description
 */
public class ClassUtils {
    public static ClassLoader getDefaultClassLoader() {
        return ClassUtils.class.getClassLoader();
    }

    public static boolean isCglibProxyClass(Class<?> clazz) {
        return clazz != null && isCglibClassName(clazz.getName());
    }

    /**
     * cglib代理的类名有$$符号
     */
    public static boolean isCglibClassName(String name) {
        return !StringUtils.isEmpty(name) && name.contains("$$");
    }

}
